import request from '@/utils/request'
import Qs from 'qs'
//获取医院列表
export function getHospitalList (params) {
  return request({
    params,
    url: '/api/hospital/admin/list'
  })
}

//代理商下拉框
export function managerList (params) {
  return request({
    params,
    url: '/api/hospital/admin/managerList'
  })
}

//新增或修改医院规则
export function setRules (data) {
  return request({
    data:Qs.stringify(data),
    method:'post',
    url: '/api/hospital-rule/admin/set',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//修改小时或超时价格
export function updateHour (params) {
  return request({
    params,
    method:'put',
    url: '/api/hospital/admin/updateHour'
  })
}

//获取医院规则
export function getRules (params) {
  return request({
    params,
    url: '/api/hospital-rule/admin/list'
  })
}

//删除医院规则
export function delRules (params) {
  return request({
    params,
    method:'delete',
    url: '/api/hospital-rule/admin/del'
  })
}

//新增或修改医院
export function setHospital (data) {
  return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/api/hospital/admin/set',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//删除医院
export function delHospital (params) {
  return request({
    method:'delete',
    params,
    url:'/api/hospital/admin/del'
  })
}

//部门列表
export function getPartList (params) {
  return request({
    params,
    url: '/api/dept/admin/list'
  })
}

// 新增或修改部门
export function setPart (data) {
  return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/api/dept/admin/set',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//医院下拉框
export function dropDownHospitalList (params) {
  return request({
    params,
    url: '/api/hospital/admin/dropDownList'
  })
}

//部门下拉框
export function dropDownPartList (params) {
  return request({
    params,
    url: '/api/dept/admin/dropDownList'
  })
}

//删除部门
export function delPart (params) {
  return request({
    method:'delete',
    params,
    url:'/api/dept/admin/del'
  })
}

// 床位绑定设备
export function bindingEquipment(data){
  return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/api/dept/admin/bind',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//床位批量解绑设备
export function unBindingEquipment(data){
  return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/api/dept/admin/unbindBatch',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//医院列表批量导入接口
export function importHosExecl(data){
  return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/api/hospital/admin/importHosExecl',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//解绑医院
export function unbind(data){
  return request({
    method:'put',
    data,
    url:'/api/hospital/admin/unbind'
  })
}

//床位批量绑定设备
export function bindingBatchEquipment(data){
  return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/api/dept/admin/bindingBatchEquipment',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}



